<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
$(function() {
    $(".table_title td:first-child").css("width", "60px");
    $("#allResult table").attr("bordercolor", "#dddddd");
});

</script>

</head>
<body>

<%
HashMap<String, Object> userMap = (HashMap<String, Object>)request.getAttribute( "userMap" );
HashMap<String, Object> areaMap = (HashMap<String, Object>)userMap.get( "area" );
HashMap<String, Object> jobMap = (HashMap<String, Object>)userMap.get( "job" );
HashMap<String, Object> ageMap = (HashMap<String, Object>)userMap.get( "age" );
HashMap<String, Object> regdateMap = (HashMap<String, Object>)userMap.get( "regdate" );
%>

<div id="monthUserCount" style="display:none;">${userMap.user.all }</div>

<table class="list" cellspacing="0" cellpadding="10" style="text-align:center;">
    <tr class="table_title">
        <td rowspan="2">성별</td>
        <td>남</td>
        <td>여</td>
    </tr>
    <tr>
        <td>${userMap.sex.man }</td>
        <td>${userMap.sex.woman }</td>
    </tr>
</table>
<br/>

<table class="list" cellspacing="0" cellpadding="10" style="text-align:center;">
    <tr class="table_title">
        <td rowspan="2">결혼유무</td>
        <td>기혼</td>
        <td>미혼</td>
    </tr>
    <tr>
        <td>${userMap.marry.marry_true }</td>
        <td>${userMap.marry.marry_false }</td>
    </tr>
</table>
<br/>

<table class="list" cellspacing="0" cellpadding="10" style="text-align:center;">
    <tr class="table_title">
        <td rowspan="2">지역</td>
        <c:forEach var="entry" items="<%=areaMap.entrySet( ) %>">
            <td>${entry.key }</td>
        </c:forEach>
    </tr>
    <tr>
        <c:forEach var="entry" items="<%=areaMap.entrySet( ) %>">
            <td>${entry.value }</td>
        </c:forEach>
    </tr>
</table>
<br/>

<table class="list" cellspacing="0" cellpadding="10" style="text-align:center;">
    <tr class="table_title">
        <td rowspan="2">직업</td>
        <c:forEach var="entry" items="<%=jobMap.entrySet( ) %>">
            <td>${entry.key }</td>
        </c:forEach>
    </tr>
    <tr>
        <c:forEach var="entry" items="<%=jobMap.entrySet( ) %>">
            <td>${entry.value }</td>
        </c:forEach>
    </tr>
</table>
<br/>

<table class="list" cellspacing="0" cellpadding="10" style="text-align:center;">
    <tr class="table_title">
        <td rowspan="2">나이</td>
        <c:forEach var="entry" items="<%=ageMap.entrySet( ) %>">
            <td>${entry.key }</td>
        </c:forEach>
    </tr>
    <tr>
        <c:forEach var="entry" items="<%=ageMap.entrySet( ) %>">
            <td>${entry.value }</td>
        </c:forEach>
    </tr>
</table>
<br/><br/>

<table class="list" width="100%" cellspacing="0" cellpadding="10" style="text-align:center;">
    <tr class="table_title">
        <td>일</td>
        <c:forEach begin="1" end="16" varStatus="stat">
            <td>${stat.index }</td>
        </c:forEach>
    </tr>
    <tr>
        <td>가입자수</td>
        <%
        for ( int i = 1; i <= 16; i++ ) {
        	%>
        	<td>
        	   <%= regdateMap.get( i ) != null ? regdateMap.get( i ) : 0 %>
        	</td>
        	<%
        }
        %>
    </tr>
</table>
<br/>

<table class="list" width="100%" cellspacing="0" cellpadding="10" style="text-align:center;">
    <tr class="table_title">
        <td>일</td>
        <c:forEach begin="17" end="31" varStatus="stat">
            <td>${stat.index }</td>
        </c:forEach>
        <td>합계</td>
    </tr>
    <tr>
        <td>가입자수</td>
        <%
        for ( int i = 17; i <= 31; i++ ) {
            %>
            <td>
               <%= regdateMap.get( i ) != null ? regdateMap.get( i ) : 0 %>
            </td>
            <%
        }
        %>
        <td>${userMap.user.all }</td>
    </tr>
</table>

</body>
</html>